const express = require('express')
const app = express()
const port = 3002
app.all("*", (req, res, next) => {
  res.header("Access-Control-Allow-Origin", "http://localhost:3001");
  res.header("Access-Control-Allow-Credentials", "true"); // ++ 
  next();
});

app.get("/crossList", (req, res) => {
  res.json({ code: 200, msg: "这是3002端口返回的" });
});

app.listen(port, () => {
  console.log(`Example app listening on port ${port}`)
})
